<script src="${request.contextPath}/assets/js/jquery3.6.0.js"></script>
<script src="${request.contextPath}/assets/js/jquery-validate/jquery.validate.js"></script>
<script src="${request.contextPath}/assets/js/jquery-validate/messages_zh.js"></script>

<form action="${request.contextPath}/province/add" method="post" id="provinceForm">
    省名： <input type="text" name="name"> <br>
    大区：<select name="area">
        <option value="华北">华北</option>
        <option value="华东">华东</option>
        <option value="华南">华南</option>
        <option value="西北">西北</option>
        <option value="西南">西南</option>
        <option value="港奥台">港奥台</option>
    </select> <br>
    优先级：<input type="text" name="priority"> <br>
    <input type="submit" value="提交">
</form>

<script>
    $(function (){
        $("#provinceForm").validate({
            rules:{
                name:{
                    required:true,
                },
                area:{
                    required:true
                },
                priority:{
                    required:true,
                    digits:true,
                    range:[0,255]
                }
            }
        });
    })
</script>